package online.flytool.base.db;

import lombok.Data;

import java.util.Properties;

/**
 * @author ：lingchong
 * date ：Created in 2022/7/3 18:04
 * @description：jdbc的属性
 * @modified By：
 * @version: $
 */
@Data
public class ConnProperty {

    private String direrClassName;
    private String url ;
    private String user ;
    private String pwd;

    /**
     * 加载数据库配置信息，并给相关的属性赋值
     */
    public static ConnProperty create(Properties prop,String userKey,String pwdKey,String direrKey,String urlKey) {
        ConnProperty property=new ConnProperty();
        property.user = prop.getProperty("jdbc.user");
        property.pwd = prop.getProperty("jdbc.pwd");
        property.direrClassName = prop.getProperty("jdbc.driver");
        property.url = prop.getProperty("jdbc.url");
        return property;
    }

}